<template>
    <div class="newsinfo-container">
        <!-- 大标题 -->
        <h3 class="title">新闻列表</h3>
        <!-- 子标题 -->
        <p class="subtitle" v-for="item in list" :key="item.id">
            <span>发表时间：{{item.time | dateFormat}}</span>
            <span>点击：{{item.click}}次</span>
        </p>

        <!-- 内容区域 -->
        <p class="content">由于api接口失效了，用不了，随便写点东西意思一下。。。</p><br><br><br>

        <!-- 评论区 -->
        <comment-box></comment-box>
    </div>
</template>

<script>
//1. 导入评论子组件
import comment from '../subcomponents/comment.vue'
export default {
    data(){
        return {
            list:[
        {time:new Date(),click:'3',id:1},
        
    ]
        }
    },
    methods:{},
    components:{
        //用来注册子组件的节点的
        "comment-box":comment
    }
}
</script>

<style lang="scss">
    .newsinfo-container{
        padding: 0 4px;
     .title{
         font-size: 16px;
         text-align: center;
         margin: 15px 0;
         color: red;
     }   
     .subtitle{
         font-size: 13px;
         color: blue;
         display: flex;
         justify-content: space-between;
     }
     .content{
         padding: 0 5px;
     }
    }
</style>